﻿@model IEnumerable<wUniApp.MVC.App_Data.Execution>
@using GridMvc.Html

@{
    ViewBag.Title = wUniApp.MVC.App_GlobalResources.Resources.Index;
    Layout = "~/Views/Shared/_Layout.cshtml";
}

@Html.GetTitle()

<p>
    @Html.CreateNew()
</p>

<h4 style="background:#cedce8;padding:10px" >Grid.MVC</h4>
<div>
  @Html.Grid(Model).Columns(columns =>
                    {
                      columns.Add(c => c.Customer.FirstName).Titled("Customer");
                      columns.Add(c => c.Description).Titled("Description").Filterable(true);
                      columns.Add(c => c.AmountDue).Titled("AmountDue");
                      columns.Add(c => c.Id).Encoded(false).Titled("").Sanitized(false).RenderValueAs(u => @Html.EDDButtons(u.Id)); 
                    }).WithPaging(3).Sortable(true)
</div>



@*<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Customer.FirstName)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Description)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.AmountDue)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Customer.FirstName)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Description)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.AmountDue)
        </td>
        <td>
          @Html.EDDButtons(item.Id)
        </td>
    </tr>
}

</table>*@
